package top.amot.forceview.model

import kotlin.math.sqrt

abstract class AbstractLink<T: AbstractNode,F:AbstractNode>(
    var source: AbstractNode,
    var target: AbstractNode,
    var text: String?
) {
    var index = -1
    open var lineType = ""

    open var linkStartPointStyle = 0
    open var linkEndPointStyle = 0

    fun length(): Float {
        val dx = source.x - target.x
        val dy = source.y - target.y
        return sqrt(dx * dx + dy * dy)
    }

}